package ua.pp.fland.multithreading.sorting;

import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Maxim Bondarenko
 * @version 1.0 Jul 2, 2010
 */

public class ThreadsRunner implements Runnable{
    private static final Logger logger = Logger.getLogger(ThreadsRunner.class);

    private final List<Integer> inputData;

    private List<Integer> outputData;

    synchronized public List<Integer> getOutputData() {
        return outputData;
    }

    public ThreadsRunner(List<Integer> inputData) {
        this.inputData = inputData;

        outputData = new ArrayList<Integer>();
    }

    public void run(){
        DataProcessor dataProcessor = new NumberDataProcessor();
        this.outputData = new ArrayList<Integer>(dataProcessor.sort(this.inputData));
    }
}
